﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "GnufInterface.h"

namespace gnuf
{
    enum class AnnouncementType : std::uint8_t 
    { 
        eLow,
        eMedium
    };

    // level low->high
    enum class AnnouncementLevel
    { 
        eSuccess, 
        eInfo, 
        eWarning, 
        eWarningInfo, 
        eNormalWarning, 
        eHighWarning, 
        eError 
    };

    class GNUF_INTERFACE_EXPORT AnnouncementInterface
    {
    public:
        static AnnouncementInterface* Get();

    public:
        virtual void PostLowAnnouncement(const std::wstring&, AnnouncementLevel) = 0;

    protected:
        AnnouncementInterface() {}

        // 此接口由UI框架调用，外部不可调用。
        // 如必须调用，请联系jianggy-a@glodon.com
        void SetInterface(AnnouncementInterface*);

    private:
        AnnouncementInterface(const AnnouncementInterface&) = delete;
        AnnouncementInterface(AnnouncementInterface&&) = delete;
        AnnouncementInterface& operator=(const AnnouncementInterface&) = delete;
    };

    GNUF_INTERFACE_EXPORT void PostAnnouncement(
        const std::wstring& text, 
        AnnouncementLevel level, 
        AnnouncementType type = AnnouncementType::eLow
    );
}
